#ifndef LL_H
#define LL_H

#include <stddef.h>

// Each node one links to the next and the previous node
typedef struct ll_node ll_node;

// A doubly linked list is constructed out of several nodes.
typedef struct ll_list ll_list;

// Create an empty list
ll_list* ll_create();

// Delete a list
void ll_delete(ll_list* list);

// Append an element to an list
void ll_push(ll_list* list, void *data);

// Remove the last element of a list
void* ll_pop(ll_list* list);

// Get element at index i
void* ll_get(ll_list* list, unsigned int i);

// Get first element
void* ll_first(ll_list* list);

// Get last element
void* ll_last(ll_list* list);

unsigned int ll_size(ll_list* list);

#endif
